<!--顶部导航-->
<div class="CommonHeader">
    <div class="CommonBackBtn"><a href="javascript:history.go(-1)"><img src="/map/images/return_black.png" alt="返回"/></a></div>
    <div class="CommonTitle">我的收藏</div>
</div>
<div class="CommonMain">

    <div class="CollectList">
    
    </div>

</div>

<script>
    $('.xingNum').each(function(){
        let that = $(this)
        let index = that.attr('data-index')
        let img = that.find('img')
        let xing='/map/images/xing.png'
        let xing_x='/map/images/xing_x.png'
        img.each(function(i){
            if(i<index){
                $(this).attr('src',xing_x)
            }else{
                $(this).attr('src',xing)
            }
        })
    })
</script>


<script type="text/javascript" src="__CDN__/assets/js/zepto.min.js"></script>
<script type="text/javascript" src="__CDN__/assets/js/PullToRefresh.min.js"></script>
<script>

    var n=1,flag=true;

    var refreshBox=new PullToRefresh({
        container:".CommonMain",

        up:{
            callback:function(){

                setTimeout(function(){
                    n++
                    re_ajax(n)
                    refreshBox.endUpLoading(flag)

                },1000)
            }
        }
    })
    re_ajax(1);
    function re_ajax(page){
        $.ajax({
            type:"GET",
            url:"{:url('user/collectshop')}",
            dataType:"json",
            data:{
                page:page

            },
            success:function(html){

                if(html=='0'){
                    flag=false;
                    $('.loadingBox').html('没有更多数据了');
                }else{
                    $('.CollectList').append(html);
                }
            },
            error:function(jqXHR){
                flag=false;
            }
        });
    }


</script>

